<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="接下来了解一下imx6ull中的lcd控制器——eLCDIF？若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV10-01-LCD驱动-03-LCD控制器">
<meta property="og:url" content="https://sumumm.github.io/post/562ab748.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="接下来了解一下imx6ull中的lcd控制器——eLCDIF？若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/LCD011.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/LCD012.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250410173212689.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250410173145926.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411093613402.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411094541467.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411094948349.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411095536632.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411095514380.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102445910.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102513858.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102600731.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102630180.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102727298.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102749667.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411104720096.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411104820855.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411115351151.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411115435787.png">
<meta property="article:published_time" content="2025-04-16T12:55:47.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.060Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV10-LCD驱动">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/LCD011.png">


<link rel="canonical" href="https://sumumm.github.io/post/562ab748.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":"","permalink":"https://sumumm.github.io/post/562ab748.html","path":"post/562ab748.html","title":"LV10-01-LCD驱动-03-LCD控制器"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV10-01-LCD驱动-03-LCD控制器 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81eLCDIF%E2%80%94%E2%80%94%E6%B6%B2%E6%99%B6%E6%8E%A7%E5%88%B6%E5%99%A8"><span class="nav-text">一、eLCDIF——液晶控制器</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-eLCDIF%E7%AE%80%E4%BB%8B"><span class="nav-text">1. eLCDIF简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E6%94%AF%E6%8C%81%E5%A4%9A%E7%A7%8D%E6%8E%A5%E5%8F%A3%EF%BC%9F"><span class="nav-text">2. 支持多种接口？</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-MPU-%E6%8E%A5%E5%8F%A3"><span class="nav-text">2.1 MPU 接口  </span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-VSYNC-%E6%8E%A5%E5%8F%A3"><span class="nav-text">2.2 VSYNC 接口  </span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-DOTCLK-%E6%8E%A5%E5%8F%A3"><span class="nav-text">2.3 DOTCLK 接口  </span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%A1%86%E5%9B%BE%E8%A7%A3%E6%9E%90"><span class="nav-text">3. 框图解析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E9%80%9A%E8%AE%AF%E5%BC%95%E8%84%9A"><span class="nav-text">3.1 通讯引脚</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E6%80%BB%E7%BA%BF%E6%8E%A5%E5%8F%A3"><span class="nav-text">3.2 总线接口</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E6%B6%B2%E6%99%B6%E6%8E%A5%E5%8F%A3%EF%BC%88LCD-Interface%EF%BC%89"><span class="nav-text">3.3 液晶接口（LCD Interface）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-4-%E9%A9%B1%E5%8A%A8%E6%97%B6%E9%92%9F"><span class="nav-text">3.4 驱动时钟</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-4-1-BUS-CLOCK%EF%BC%88apb-clk%EF%BC%89"><span class="nav-text">3.4.1 BUS CLOCK（apb_clk）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-4-2-DISPLAY-CLOCK%EF%BC%88pix-clk%EF%BC%89"><span class="nav-text">3.4.2 DISPLAY CLOCK（pix_clk）</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E6%95%B0%E6%8D%AE%E4%BC%A0%E8%BE%93%E4%B8%8E%E5%A4%84%E7%90%86"><span class="nav-text">4. 数据传输与处理</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81eLCDIF%E5%AF%84%E5%AD%98%E5%99%A8"><span class="nav-text">二、eLCDIF寄存器</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-LCDIF-CTRLn"><span class="nav-text">1. LCDIF_CTRLn</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-LCDIF-CTRL1n"><span class="nav-text">2. LCDIF_CTRL1n</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-LCDIF-TRANSFER-COUNT"><span class="nav-text">3. LCDIF_TRANSFER_COUNT </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-LCDIF-VDCTRL0n"><span class="nav-text">4. LCDIF_VDCTRL0n</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-LCDIF-VDCTRL1"><span class="nav-text">5. LCDIF_VDCTRL1 </span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-LCDIF-VDCTRL2"><span class="nav-text">6. LCDIF_VDCTRL2</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-LCDIF-VDCTRL3"><span class="nav-text">7. LCDIF_VDCTRL3</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-LCDIF-VDCTRL4"><span class="nav-text">8. LCDIF_VDCTRL4</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#9-LCDIF-CUR-BUF"><span class="nav-text">9. LCDIF_CUR_BUF</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#10-LCDIF-NEXT-BUF"><span class="nav-text">10. LCDIF_NEXT_BUF</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E8%A3%B8%E6%9C%BAdemo"><span class="nav-text">三、裸机demo</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E7%A1%AC%E4%BB%B6%E5%8E%9F%E7%90%86%E5%9B%BE"><span class="nav-text">1. 硬件原理图</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E7%94%B5%E8%B7%AF%E5%8E%9F%E7%90%86%E5%9B%BE"><span class="nav-text">1.1 电路原理图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E8%BF%9E%E6%8E%A5%E6%96%B9%E5%BC%8F"><span class="nav-text">1.2 连接方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-%E5%8F%82%E6%95%B0%E8%AE%A1%E7%AE%97"><span class="nav-text">1.3 参数计算</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E7%94%9F%E6%88%90%E5%AD%97%E6%A8%A1"><span class="nav-text">2. 生成字模</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-demo%E6%BA%90%E7%A0%81"><span class="nav-text">3. demo源码</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E5%87%BA%E7%8E%B0%E7%9A%84%E6%8A%A5%E9%94%99%E9%97%AE%E9%A2%98"><span class="nav-text">3.1 出现的报错问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95"><span class="nav-text">3.2 解决办法</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/562ab748.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV10-01-LCD驱动-03-LCD控制器 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV10-01-LCD驱动-03-LCD控制器
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2025-04-16 20:55:47" itemprop="dateCreated datePublished" datetime="2025-04-16T20:55:47+08:00">2025-04-16</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/" itemprop="url" rel="index"><span itemprop="name">02IMX6ULL平台</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/" itemprop="url" rel="index"><span itemprop="name">LV10-LCD驱动</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>8k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>29 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>接下来了解一下imx6ull中的lcd控制器——eLCDIF？若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" rowspan="5">PC端开发环境</td>        <td align="center" width=150px>Windows</td>        <td align="left">Windows11</td>    </tr>    <tr>        <td align="center">Ubuntu</td>        <td align="left">Ubuntu20.04.2的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 17 Pro</td>        <td align="left">17.6.0 build-24238078</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>    </tr>    <tr>        <td align="center">Win32DiskImager</td>        <td align="left">Win32DiskImager v1.0</td>      </tr>    <tr>        <td align="center" rowspan="3">Linux开发板环境</td>        <td align="center">Linux开发板</td>        <td align="left">正点原子 i.MX6ULL Linux 阿尔法开发板</td>      </tr>    <tr>        <td align="center">uboot</td>        <td align="left">NXP官方提供的uboot，使用的uboot版本为U-Boot 2019.04</td>      </tr>    <tr>        <td align="center">linux内核</td>        <td align="left">linux-4.19.71(NXP官方提供)</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="5">官方网站</td>        <td align="left"><a href="https://www.arm.com/" target="_blank">https://www.arm.com/</a></td>        <td align="left">ARM官方网站，在这里我们可以找到Cotex-Mx以及ARMVx的一些文档</td>    </tr>    <tr>        <td align="left"><a href="https://www.nxp.com.cn/" target="_blank">https://www.nxp.com.cn/ </a></td>        <td align="left">NXP官方网站</td>    </tr>    <tr>        <td align="left"><a href="https://www.nxpic.org.cn/" target="_blank">https://www.nxpic.org.cn/</a></td><td align="left">NXP 官方社区</td>    </tr>    <tr>        <td align="left"><a href="https://u-boot.readthedocs.io/en/latest/" target="_blank">https://u-boot.readthedocs.io/en/latest/</a></td><td align="left">u-boot官网</td>    </tr>    <tr>        <td align="left"><a href="https://www.kernel.org/" target="_blank">https://www.kernel.org/</a></td><td align="left">linux内核官网</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="3">NXP</td>        <td align="left"><a href="https://github.com/nxp-imx" target="_blank">https://github.com/nxp-imx</a></td>        <td align="left">NXP imx开发资源GitHub组织，里边会有u-boot和linux内核的仓库</td>    </tr>    <tr>        <td align="left"><a href="https://github.com/nxp-imx/linux-imx/releases/tag/v4.19.71" target="_blank">nxp-imx/linux-imx/releases/tag/v4.19.71</a></td>        <td align="left">NXP linux内核仓库tags中的v4.19.71</td>    </tr>    <tr>        <td align="left"><a href="https://github.com/nxp-imx/uboot-imx/releases/tag/rel_imx_4.19.35_1.1.0" target="_blank">nxp-imx/uboot-imx/releases/tag/rel_imx_4.19.35_1.1.0</a></td>        <td align="left">NXP u-boot仓库tags中的rel_imx_4.19.35_1.1.0</td>    </tr>    <tr>        <td align="center" rowspan="2">I.MX6ULL</td>        <td align="left"><a href="https://www.nxp.com.cn/docs/en/data-sheet/IMX6ULLIEC.pdf" target="_blank">i.MX 6ULL Applications Processors for Industrial Products</a></td>        <td align="left">I.MX6ULL 芯片手册（datasheet，可以在线查看）</td>    </tr>    <tr>        <td align="left"><a href="https://www.nxp.com.cn/webapp/Download?colCode=IMX6ULLRM&lang_cd=zh" target="_blank">i.MX 6ULL Applications ProcessorReference Manual</a></td>        <td align="left">I.MX6ULL 参考手册（下载后才能查看，需要登录NXP官网）</td>    </tr>    <tr>        <td align="center" rowspan="3">Source Code</td>        <td align="left"><a href="https://elixir.bootlin.com/linux/latest/source" target="_blank">https://elixir.bootlin.com/linux/latest/source</a></td>        <td align="left">linux kernel源码</td>    </tr>    <tr>        <td align="left"><a href="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/?h=v4.19.71&id=e7d2672c66e4d3675570369bf20856296da312c4" target="_blank">kernel/git/stable/linux.git - Linux kernel stable tree</a></td>        <td align="left">linux kernel源码(官网,tag 4.19.71)</td>    </tr>    <tr>        <td align="left"><a href="https://elixir.bootlin.com/u-boot/latest/source" target="_blank">https://elixir.bootlin.com/u-boot/latest/source</a></td>        <td align="left">uboot源码</td>    </tr></table>
              </div>
            </details>

<h1 id="一、eLCDIF——液晶控制器"><a href="#一、eLCDIF——液晶控制器" class="headerlink" title="一、eLCDIF——液晶控制器"></a><font size=3>一、eLCDIF——液晶控制器</font></h1><h2 id="1-eLCDIF简介"><a href="#1-eLCDIF简介" class="headerlink" title="1. eLCDIF简介"></a><font size=3>1. eLCDIF简介</font></h2><p>IMX6U系列芯片内部自带一个增强型液晶接口外设eLCDIF（Enhanced LCD Interface），配合使用DDR作为显存， 可直接控制液晶面板，无需额外增加液晶控制器芯片。</p>
<p>IMX6U的eLCDIF液晶控制器最高支持1366x768分辨率的屏幕； 可支持多种颜色格式，包括RGB888、RGB565、ARGB8888等(其中的“A”是指透明像素)。 还可配合像素渲染流水线PXP（Pixel Pipeline）进行复杂的图像处理，如格式转换、缩放、翻转以及图层混合等操作， 使IMX6U有非常出色的图形显示性能。特性如下：</p>
<p>①、支持DOTCLK模式，也就是 RGB LCD 的 DE 模式。  </p>
<p>②、支持 VSYNC 模式以实现高速数据传输，跟MPU模式类似，多了VSYNC信号。针对高速数据传输（行场信号）。</p>
<p>③、支持MPU模式：有些显示屏自带显存，只需要把命令、数据发送给显示屏即可；就是前面讲的8080接口</p>
<p>④、支持 ITU-R BT.656 格式的 4:2:2 的 YCbCr 数字视频，并且将其转换为模拟 TV 信号。</p>
<p>⑤、支持 8&#x2F;16&#x2F;18&#x2F;24&#x2F;32 位 LCD，取决于IO的复用设置及寄存器配置。</p>
<h2 id="2-支持多种接口？"><a href="#2-支持多种接口？" class="headerlink" title="2. 支持多种接口？"></a><font size=3>2. 支持多种接口？</font></h2><p>eLCDIF 支持三种接口： MPU 接口、 VSYNC 接口和 DOTCLK 接口。</p>
<h3 id="2-1-MPU-接口"><a href="#2-1-MPU-接口" class="headerlink" title="2.1 MPU 接口  "></a><font size=3>2.1 MPU 接口  </font></h3><p>MPU 接口用于在 I.MX6U 和 LCD 屏幕直接传输数据和命令，这个接口用于 6080&#x2F;8080 接口的 LCD 屏幕，比如我们学习 STM32 的时候常用到的 MCU 屏幕。如果寄存器 LCDIF_CTRL的位 DOTCLK_MODE、 DVI_MODE 和 VSYNC_MODE 都为 0 的话就表示 LCDIF 工作在 MPU接口模式。</p>
<p>关于 MPU 接口的详细信息以及时序参考《I.MX6ULL 参考手册》第 2150 页的“34.4.6 MPU Interface”小节.</p>
<h3 id="2-2-VSYNC-接口"><a href="#2-2-VSYNC-接口" class="headerlink" title="2.2 VSYNC 接口  "></a><font size=3>2.2 VSYNC 接口  </font></h3><p>VSYNC 接口时序和 MPU 接口时序基本一样，只是多了 VSYNC 信号来作为帧同步，当LCDIF_CTRL 的位 VSYNC_MODE 为 1 的时候此接口使能。  </p>
<p>关于 VSYNC 接口的详细信息可以参考《I.MX6ULL 参考手册》第 2152 页的“34.4.7 VSYNC Interface”小节 。</p>
<h3 id="2-3-DOTCLK-接口"><a href="#2-3-DOTCLK-接口" class="headerlink" title="2.3 DOTCLK 接口  "></a><font size=3>2.3 DOTCLK 接口  </font></h3><p>DOTCLK 接口就是用来连接 RGB LCD 接口屏幕的， 它包括 VSYNC、 HSYNC、 DOTCLK和 ENABLE(可选的)这四个信号，这样的接口通常被称为 RGB 接口。</p>
<p>可以看《I.MX6ULL 参考手册》——34.4.8 DOTCLK Interface  </p>
<h2 id="3-框图解析"><a href="#3-框图解析" class="headerlink" title="3. 框图解析"></a><font size=3>3. 框图解析</font></h2><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/LCD011.png" alt="eLCDIF控制器的结构框图"  />

<h3 id="3-1-通讯引脚"><a href="#3-1-通讯引脚" class="headerlink" title="3.1 通讯引脚"></a><font size=3>3.1 通讯引脚</font></h3><p>上图的标号 1 处表示eLCDIF的通讯引脚，eLCDIF的通讯引脚与液晶显示面板控制信号一一对应， 包含有HSYNC、VSYNC、DE、CLK以及RGB数据线各8根。设计硬件时把液晶面板与IMX6对应的这些引脚连接起来即可， 查阅《I.MX6ULL 参考手册》——Table 34-5. Pin use in DOTCLK Mode ，可获知eLCDIF信号线对应的引脚，具体见下表。</p>
<h3 id="3-2-总线接口"><a href="#3-2-总线接口" class="headerlink" title="3.2 总线接口"></a><font size=3>3.2 总线接口</font></h3><p>eLCDIF的液晶接口有两个总线接口，System Bus总线，用于向eLCDIF液晶接口的FIFO中写入数据。 而Control Bus用于设置eLCDIF用于读、写控制寄存器以及DMA、数据寄存器等等。</p>
<h3 id="3-3-液晶接口（LCD-Interface）"><a href="#3-3-液晶接口（LCD-Interface）" class="headerlink" title="3.3 液晶接口（LCD Interface）"></a><font size=3>3.3 液晶接口（LCD Interface）</font></h3><p>上图的标号处表示eLCDIF的液晶接口（LCD Interface），它是eLCDIF外设的主要功能部件，受控制总线（Control Bus）的寄存器控制， 从系统总线（System Bus）获得输入像素数据，经过一系列转换后通过eLCDIF的通讯引脚发送至外接的液晶面板。</p>
<p>其中控制总线的寄存器可以配置显存地址、输入像素数据的格式、输出的数据信号线宽度、 各个控制信号的有效极性以及控制时序中的VSW、VBP等参数，还能配置使用DMA传输。</p>
<p>使用寄存器初始化好eLCDIF的后，它会从“LFIFO”和“TXFIFO”中获取数据进行转换处理（格式转换、移位等操作）并传输出去。 当FIFO中的数据量低于一定程度时，它会向系统总线（SystemBus）发起请求，系统总线会把显存地址的数据搬运至FIFO中。 FIFO还可以配置阈值，低于该阈值时系统总线会提高获取数据的优先级。</p>
<p>eLCDIF正常运行后，数据从显存到液晶屏全程不需要内核的干预，程序控制时我们只要把像素数据写入到显存即可。</p>
<h3 id="3-4-驱动时钟"><a href="#3-4-驱动时钟" class="headerlink" title="3.4 驱动时钟"></a><font size=3>3.4 驱动时钟</font></h3><p>elcdf模块包含两个时钟信号，分别是BUS CLOCK（apb_clk）和DISPLAY CLOCK（pix_clk）。</p>
<h4 id="3-4-1-BUS-CLOCK（apb-clk）"><a href="#3-4-1-BUS-CLOCK（apb-clk）" class="headerlink" title="3.4.1 BUS CLOCK（apb_clk）"></a><font size=3>3.4.1 BUS CLOCK（apb_clk）</font></h4><p>这个BUS CLOCK（apb_clk）就是指eLCDIF外设的 根时钟LCDIF_CLK_ROOT，它给eLCDIF提供驱动的时钟源，在时钟树中的结构具体如下图所示。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/LCD012.png" alt="根时钟"  />

<p>LCDIF_CLK_ROOT根时钟可以选择多种输入时钟源，首先是时钟源预选择器（Pre-multiplexer）支持使用如下时钟：</p>
<ul>
<li>PLL2：System PLL，该时钟频率通常为528MHz。</li>
<li>PLL2 PFD0：该时钟常规配置为352MHz。</li>
<li>PLL2 PFD1：该时钟常规配置为594MHz。</li>
<li>PLL3 PFD3：该时钟常规配置为454.74MHz。</li>
<li>PLL3 PFD1：该时钟常规配置为664.62MHz。</li>
<li>PLL5：Video PLL，该时钟常规配置为649.52MHz。</li>
</ul>
<p>预选择器得到的时钟，可根据需要进行分频配置，分频后输入到时钟源选择器（multiplexer）作为LCDIF_CLK_ROOT默认的时钟源， 除此之外，图中的时钟的选择器还包含其它可选的输入时钟：ipp_di0_clk、ipp_di1_clk、ldb_di0_clk、ldb_di1_clk， 不过关于这些时钟在参考手册中并没有介绍，而且在寄存器中并没有这些时钟源的分频、选择的配置， 也许该选择器是兼容其它设备而保留的内容，所以使用时我们直接选择预选择器得到的时钟作为LCDIF_CLK_ROOT的输入时钟源即可。</p>
<h4 id="3-4-2-DISPLAY-CLOCK（pix-clk）"><a href="#3-4-2-DISPLAY-CLOCK（pix-clk）" class="headerlink" title="3.4.2 DISPLAY CLOCK（pix_clk）"></a><font size=3>3.4.2 DISPLAY CLOCK（pix_clk）</font></h4><p>这个DISPLAY CLOCK（pix_clk）是指eLCDIF与液晶面板接口的 像素时钟LCDIF_pix_clk，它的时钟频率与根时钟LCDIF_CLK_ROOT一致，不过它们 的时钟开关是分开的，其中 LCDIF_CLK_ROOT 使用寄存器位CCM_CCGR2[CG14] 控制，而LCDIF_pix_clk使用寄存器位CCM_CCGR3[CG5]控制。</p>
<h2 id="4-数据传输与处理"><a href="#4-数据传输与处理" class="headerlink" title="4. 数据传输与处理"></a><font size=3>4. 数据传输与处理</font></h2><p>这里就简单了解下吧，看看手册中的框图。</p>
<ul>
<li>《I.MX6ULL 参考手册》——34.4.2 Write Data Path</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250410173212689.png" alt="image-20250410173212689"  />

<ul>
<li>《I.MX6ULL 参考手册》——34.4.3 Read Data Path</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250410173145926.png" alt="image-20250410173145926"  />

<h1 id="二、eLCDIF寄存器"><a href="#二、eLCDIF寄存器" class="headerlink" title="二、eLCDIF寄存器"></a><font size=3>二、eLCDIF寄存器</font></h1><p>查看任何芯片的LCD控制器寄存器时，记住几个要点：</p>
<p>① 怎么把LCD的信息告诉LCD控制器：即分辨率、行列时序、像素时钟等；</p>
<p>② 怎么把显存地址、像素格式告诉LCD控制器。</p>
<p>对于i.MX6ULL来说，我们可以看《I.MX6ULL参考手册》——34.6 eLCDIF Memory Map&#x2F;Register Definition  </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411093613402.png" alt="image-20250411093613402"  />

<h2 id="1-LCDIF-CTRLn"><a href="#1-LCDIF-CTRLn" class="headerlink" title="1. LCDIF_CTRLn"></a><font size=3>1. LCDIF_CTRLn</font></h2><p>eLCDIF General Control Register (LCDIF_CTRLn)：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411094541467.png" alt="image-20250411094541467"  />

<table style="font-size: 13px">
    <tr>
        <td>位域 </td>
        <td>名称 </td>
        <td>读写</td>
        <td>描述 </td>
    </tr>
    <tr>
        <td>[31] </td>
        <td>SFTRST </td>
        <td>R/W </td>
        <td>软件复位，正常工作时应设为0；如果设为1，它会复位整个LCD控制器 </td>
    </tr>
    <tr>
        <td>[30] </td>
        <td>CLKGATE </td>
        <td>R/W </td>
        <td>时钟开关， 0：正常工作时要设置为0； 1：关闭LCD控制器时钟 </td>
    </tr>
    <tr>
        <td>[29] </td>
        <td>YCBCR422_INPUT </td>
        <td>R/W </td>
        <td>使用RGB接口时，设置为0；其他接口我们暂时不关心 </td>
    </tr>
    <tr>
        <td>[28] </td>
        <td>READ_WRITEB </td>
        <td>R/W </td>
        <td>使用RGB接口时，设置为0；其他接口我们暂时不关心 </td>
    </tr>
    <tr>
        <td>[27] </td>
        <td>WAIT_FOR_VSYNC_EDGE </td>
        <td>R/W </td>
        <td>在VSYNC模式时，设置为1；我们不关心 </td>
    </tr>
    <tr>
        <td>[26] </td>
        <td>DATA_SHIFT_DIR </td>
        <td>R/W </td>
        <td>在DVI模式下才需要设置，我们不关心 </td>
    </tr>
    <tr>
        <td>[25:21] </td>
        <td>SHIFT_NUM_BITS </td>
        <td>R/W </td>
        <td>在DVI模式下才需要设置，我们不关心 </td>
    </tr>
    <tr>
        <td>[20] </td>
        <td>DVI_MODE </td>
        <td>R/W </td>
        <td>设置为1时，使用DVI模式，就是ITU-R BT.656数字接口 </td>
    </tr>
    <tr>
        <td>[19] </td>
        <td>BYPASS_COUNT </td>
        <td>R/W </td>
        <td>DOTCLK和DVI模式下需要设置为1;MPU、VSYNC模式时设为0 </td>
    </tr>
    <tr>
        <td>[18] </td>
        <td>VSYNC_MODE </td>
        <td>R/W </td>
        <td>使用VSYNC模式时，设置为1 </td>
    </tr>
    <tr>
        <td>[17] </td>
        <td>DOTCLK_MODE </td>
        <td>R/W </td>
        <td>使用DOTCLK模式时，设置为1；本实验用的就是这个模式 </td>
    </tr>
    <tr>
        <td>[16] </td>
        <td>DATA_SELECT </td>
        <td>R/W </td>
        <td>MPU模式下才用到，我们不关心 </td>
    </tr>
    <tr>
        <td>[15:14] </td>
        <td>INPUT_DATA_SWIZZLE </td>
        <td>R/W </td>
        <td>显存中像素颜色的数据转给LCD控制器时，字节位置是否交换： <br />0x0：NO_SWAP，不交换； <br />0x0：LITTLE_ENDIAN，小字节序，跟NO_SWAP一样；
            <br />0x1：BIG_ENDIAN_SWAP，字节0、3交换；字节1、2交换； <br />0x1：SWAP_ALL_BYTES，字节0、3交换；字节1、2交换；
            <br />0x2：HWD_SWAP，半字交换，即0x12345678转为0x56781234 <br />0x3：HWD_BYTE_SWAP，在每个半字内部放换字节，
            即0x12345678转换为0x34127856 </td>
    </tr>
    <tr>
        <td>[13:12] </td>
        <td>CSC_DATA_SWIZZLE </td>
        <td>R/W </td>
        <td>显存中的数据被传入LCD控制器内部并被转换为24BPP后，在它被转给LCD接口之前，字节位置是否交换： 0x0：NO_SWAP，不交换； 0x0：LITTLE_ENDIAN，小字节序，跟NO_SWAP一样；
            0x1：BIG_ENDIAN_SWAP，字节0、3交换；字节1、2交换； 0x1：SWAP_ALL_BYTES，字节0、3交换；字节1、2交换；
            0x2：HWD_SWAP，半字交换，即0x12345678转为0x56781234 0x3：HWD_BYTE_SWAP，在每个半字内部放换字节， 即0x12345678转换为0x34127856 </td>
    </tr>
    <tr>
        <td>[11:10] </td>
        <td>LCD_DATABUS_WIDTH </td>
        <td>R/W </td>
        <td>LCD数据总线宽度，就是对外输出的LCD数据的位宽， 0x0：16位； 0x1：8位； 0x2：18位； 0x3：24位 </td>
    </tr>
    <tr>
        <td>[9:8] </td>
        <td>WORD_LENGTH </td>
        <td>R/W </td>
        <td>输入的数据格式，即显存中每个像素占多少位， 0x0：16位； 0x1：8位； 0x2：18位； 0x3：24位 </td>
    </tr>
    <tr>
        <td>[7] </td>
        <td>RGB_TO_YCBCR422_CSC </td>
        <td>R/W </td>
        <td>设置为1时，使能颜色空间转换：RGB转为YCbCr </td>
    </tr>
    <tr>
        <td>[6] </td>
        <td>ENABLE_PXP_HANDSHAKE </td>
        <td>R/W </td>
        <td>当LCDIF_MASTER设置为1时，再设置这位， 则LCD控制器跟PXP之间的握手机制被关闭(我们不关心) </td>
    </tr>
    <tr>
        <td>[5] </td>
        <td>MASTER </td>
        <td>R/W </td>
        <td>设置为1时，LCD控制器成为bus master </td>
    </tr>
    <tr>
        <td>[4] </td>
        <td>RSRVD0 </td>
        <td>R/W </td>
        <td>保留 </td>
    </tr>
    <tr>
        <td>[3] </td>
        <td>DATA_FORMAT_16_BIT </td>
        <td>R/W </td>
        <td>WORD_LENGTH为0时，表示一个像素用16位，此位作用如下： 0：数据格式为ARGB555； 1：数据格式为RGB565 </td>
    </tr>
    <tr>
        <td>[2] </td>
        <td>DATA_FORMAT_18_BIT </td>
        <td>R/W </td>
        <td>WORD_LENGTH为2时，表示一个像素用18位，RGB数据还是保存在32位数据里，此位作用如下： 0：低18位用来表示RGB666，高14位无效 1：高18位用来表示RGB666，低14位无效 </td>
    </tr>
    <tr>
        <td>[1] </td>
        <td>DATA_FORMAT_24_BIT </td>
        <td>R/W </td>
        <td>WORD_LENGTH为3时，表示一个像素用24位，此位作用如下： 0：所有的24位数据都有效，格式为RGB888 1：转给LCD控制器的数据是24位的，但只用到其中的18位，
            每个字节用来表示一个原色，每字节中高2位无效 </td>
    </tr>
    <tr>
        <td>[0] </td>
        <td>RUN </td>
        <td>R/W </td>
        <td>使能LCD控制器，开始传输数据 </td>
    </tr>
</table>

<h2 id="2-LCDIF-CTRL1n"><a href="#2-LCDIF-CTRL1n" class="headerlink" title="2. LCDIF_CTRL1n"></a><font size=3>2. LCDIF_CTRL1n</font></h2><p>eLCDIF General Control1 Register (LCDIF_CTRL1n)：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411094948349.png" alt="image-20250411094948349"  />

<p>我是使用TFT LCD，LCD控制器使用DOTCLK模式。本寄存器会用到BYTE_PACKING_FORMAT 。</p>
<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[19:16]</td>
        <td>BYTE_PACKING_FORMAT </td>
        <td> R/W </td>
        <td> 用来表示一个32位的word中，哪些字节是有效的，即哪些字节是用来表示颜色的。 bit16、17、18、19分别对应byte0、1、2、3；某位为1，就表示对应的字节有效。
            默认值是0xf，表示32位的word中，所有字节都有效。 对于8bpp，可以忽略本设置，所有的字节都是有效的； 对于16bpp，bit[1:0]、bit[3:2]分别对应一个字节，组合中的2位都为1时，对应的字节才有效；
            对于24bpp，0x7表示32位数据中只用到3个字节，这称为“24 bit unpacked format”，即ARGB，其中的A字节被丢弃</td>
    </tr>
    <tr>
        <td>[0] </td>
        <td>RESET </td>
        <td> R/W </td>
        <td> 用来复位了接的LCD， 0：LCD_RESET引脚输出低电平； 1：LCD_RESET引脚输出高电平</td>
    </tr>
</table>

<h2 id="3-LCDIF-TRANSFER-COUNT"><a href="#3-LCDIF-TRANSFER-COUNT" class="headerlink" title="3. LCDIF_TRANSFER_COUNT "></a><font size=3>3. LCDIF_TRANSFER_COUNT </font></h2><p>eLCDIF Horizontal and Vertical Valid Data Count Register(LCDIF_TRANSFER_COUNT)：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411095536632.png" alt="image-20250411095536632"  />

<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[31:16]</td>
        <td>V_COUNT</td>
        <td>R/W</td>
        <td>一帧中，有多少行有效数据，高16位是V_COUNT，是 LCD 的垂直分辨率。</td>
    <tr>
    <tr>
        <td>[15:0] </td>
        <td>H_COUNT</td>
        <td>R/W</td>
        <td>一行中，有多少个像素，低 16 位是 H_COUNT，是 LCD 的水平分辨率。</td>
    <tr>
</table>

<p>如果 LCD 分辨率为1024*600 的话，那么 V_COUNT 就是 600， H_COUNT 就是 1024。  </p>
<h2 id="4-LCDIF-VDCTRL0n"><a href="#4-LCDIF-VDCTRL0n" class="headerlink" title="4. LCDIF_VDCTRL0n"></a><font size=3>4. LCDIF_VDCTRL0n</font></h2><p>eLCDIF VSYNC Mode and Dotclk Mode Control Register0(LCDIF_VDCTRL0n)：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411095514380.png" alt="image-20250411095514380"  />

<p>本寄存器用来设置Vsync信号相关的时序，及极性。</p>
<table style="font-size: 13px">
    <tr>
        <td>位域 </td>
        <td>名称</td>
        <td>读写</td>
        <td>描述 </td>
    </tr>
    <tr>
        <td>[29] </td>
        <td>VSYNC_OEB </td>
        <td>R/W </td>
        <td>用来控制VSYNC信号，对于DOTCLK模式，设为0， 0：VSYNC是输出引脚，用LCD控制器产生； 1：VSYNC是输入引脚 </td>
    </tr>
    <tr>
        <td>[28] </td>
        <td>ENABLE_PRESENT </td>
        <td>R/W </td>
        <td>在DOTCLK模式下，硬件是否会产生数据使能信号ENALBE： 0：不产生； 1：产生 </td>
    </tr>
    <tr>
        <td>[27] </td>
        <td>VSYNC_POL </td>
        <td>R/W </td>
        <td>用来决定VSYNC脉冲的极性， 0：低脉冲； 1：高脉冲 </td>
    </tr>
    <tr>
        <td>[26] </td>
        <td>HSYNC_POL </td>
        <td>R/W </td>
        <td>用来决定HSYNC脉冲的极性， 0：低脉冲； 1：高脉冲 </td>
    </tr>
    <tr>
        <td>[25] </td>
        <td>DOTCLK_POL </td>
        <td>R/W </td>
        <td>用来决定DOTCLK的极性， 0：LCD控制器在DOTCLK下降沿发送数据，LCD在上升沿捕获数据； 1：反过来 </td>
    </tr>
    <tr>
        <td>[24] </td>
        <td>ENABLE_POL </td>
        <td>R/W </td>
        <td>用来决定ENABLE信号的极性， 0：数据有效期间，ENABLE信号为低； 1：反过来 </td>
    </tr>
    <tr>
        <td>[21] </td>
        <td>VSYNC_PERIOD_UNIT </td>
        <td>R/W </td>
        <td>用来决定VSYNC_PERIOD的单位， 0：单位是像素时钟(pix_clk)，这在VSYNC模式下使用； 1：单位是“整行”，这在DOTCLK模式下使用 </td>
    </tr>
    <tr>
        <td>[20] </td>
        <td>VSYNC_PULSE_WIDTH_UNIT </td>
        <td>R/W </td>
        <td>用来决定VSYNC_PULSE_WIDTH的单位， 0：单位是像素时钟(pix_clk)； 1：单位是“整行” </td>
    </tr>
    <tr>
        <td>[19] </td>
        <td>HALF_LINE </td>
        <td>R/W </td>
        <td>VSYNC周期是否周加上半行的时间， 0：VSYNC周期=VSYNC_PERIOD； 1：VSYNC周期=VSYNC_PERIOD+HORIZONTAL_PERIOD/2 </td>
    </tr>
    <tr>
        <td>[18] </td>
        <td>HALF_LINE_MODE </td>
        <td>R/W </td>
        <td>0：第1帧将在一行的中间结束，第2帧在一行的中间开始； 1：所有帧结束前都加上半行时间，这样所有帧都会起始于“行的开头” </td>
    </tr>
    <tr>
        <td>[17:0]</td>
        <td>VSYNC_PULSE_WIDTH </td>
        <td>R/W </td>
        <td>VSYNC脉冲的宽度 </td>
    </tr>
</table>

<h2 id="5-LCDIF-VDCTRL1"><a href="#5-LCDIF-VDCTRL1" class="headerlink" title="5. LCDIF_VDCTRL1 "></a><font size=3>5. LCDIF_VDCTRL1 </font></h2><p>eLCDIF VSYNC Mode and Dotclk Mode Control Register1(LCDIF_VDCTRL1):</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102445910.png" alt="image-20250411102445910"  />

<table style="font-size: 13px">
    <tr>
        <td>位域</td>
        <td>名称 </td>
        <td>读写</td>
        <td>描述 </td>
    </tr>
    <tr>
        <td>[29]</td>
        <td>VSYNC_PERIOD</td>
        <td>R/W </td>
        <td>两个垂直同步信号之间的间隔，即垂直方向同步信号的总周期； 单位由VSYNC_PERIOD_UNIT决定 </td>
    </tr>
</table>

<p>这个寄存器是 VSYNC 和 DOTCLK 模式控制寄存器 1，此寄存器只有一个功能，用来设置 VSYNC 总周期，就是：屏幕高度+VSPW+VBP+VFP。  </p>
<h2 id="6-LCDIF-VDCTRL2"><a href="#6-LCDIF-VDCTRL2" class="headerlink" title="6. LCDIF_VDCTRL2"></a><font size=3>6. LCDIF_VDCTRL2</font></h2><p>LCDIF VSYNC Mode and Dotclk Mode Control Register2(LCDIF_VDCTRL2):</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102513858.png" alt="image-20250411102513858"  />

<p> HSYNC_PULSE_WIDTH：水平同步信号脉冲宽度；</p>
<p> HSYNC_PERIOD：两个水平同步信号之间的总数，即水平方向同步信号的总周期</p>
<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[31:18] </td>
        <td> HSYNC_PULSE_WIDTH </td>
        <td> R/W </td>
        <td> HSYNC脉冲的宽度(单位：pix_clk) </td>
    </tr>
    <tr>
        <td>[17:0] </td>
        <td> HSYNC_PERIOD </td>
        <td> R/W </td>
        <td> 整行的宽度，即两个HYSNC信号之间的宽度(单位：pix_clk) </td>
    </tr>
</table>

<p>这个寄存器分为高 16 位和低 16 位两部分，高 16位是 HSYNC_PULSE_WIDTH，用来设置 HSYNC 信号宽度，也就是 HSPW。低 16 位是HSYNC_PERIOD，设置 HSYNC 总周期，就是：屏幕宽度+HSPW+HBP+HFP。  </p>
<h2 id="7-LCDIF-VDCTRL3"><a href="#7-LCDIF-VDCTRL3" class="headerlink" title="7. LCDIF_VDCTRL3"></a><font size=3>7. LCDIF_VDCTRL3</font></h2><p>eLCDIF VSYNC Mode and Dotclk Mode Control Register3(LCDIF_VDCTRL3):</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102600731.png" alt="image-20250411102600731"  />

<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[29] </td>
        <td> MUX_SYNC_SIGNALS </td>
        <td> R/W </td>
        <td> 用不着 </td>
    </tr>
    <tr>
        <td>[28] </td>
        <td> VSYNC_ONLY </td>
        <td> R/W </td>
        <td> 0：DOTCLK模式时必须设置为0； 1：VSYNC模式时必须设置为1 </td>
    </tr>
    <tr>
        <td>[27:16] </td>
        <td> HORIZONTAL_WAIT_CNT </td>
        <td> R/W </td>
        <td> 水平方向上的等待像素个数，等于thp+thb </td>
    </tr>
    <tr>
        <td>[15:0] </td>
        <td> VERTICAL_WAIT_CNT </td>
        <td> R/W </td>
        <td> 垂直方向上的等待行数，等于tvp+tvb </td>
    </tr>
</table>

<p>HORIZONTAL_WAIT_CNT(bit27:16)：此位用于 DOTCLK 模式，用于设置 HSYNC 信号产生到有效数据产生之间的时间，也就是 HSPW+HBP。  </p>
<p>VERTICAL_WAIR_CNT(bit15:0)：和 HORIZONTAL_WAIT_CNT 一样，只是此位用于VSYNC 信号，也就是 VSPW+VBP。  </p>
<h2 id="8-LCDIF-VDCTRL4"><a href="#8-LCDIF-VDCTRL4" class="headerlink" title="8. LCDIF_VDCTRL4"></a><font size=3>8. LCDIF_VDCTRL4</font></h2><p>eLCDIF VSYNC Mode and Dotclk Mode Control Register4(LCDIF_VDCTRL4):</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102630180.png" alt="image-20250411102630180"  />

<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[31:29] </td>
        <td> DOTCLK_DLY_SEL </td>
        <td> R/W </td>
        <td> 在LCD控制器内部的DOTCLK输出到LCD_DOTCK引脚时，延时多久： 0：2ns； 1：4ns； 2：6ns； 3：8ns； 其他值保留 </td>
    </tr>
    <tr>
        <td>[18] </td>
        <td> SYNC_SIGNALS_ON </td>
        <td> R/W </td>
        <td> 同步信号使能位，设置为 1 的话使能 VSYNC、 HSYNC、DOTCLK 这些信号。DOTCLK模式下必须设为1 </td>
    </tr>
    <tr>
        <td>[17:0] </td>
        <td> DOTCLK_H_VALID_DATA_CNT </td>
        <td> R/W </td>
        <td> 水平方向上的有效像素个数(pix_clk)，即分辨率的y </td>
    </tr>
</table>



<h2 id="9-LCDIF-CUR-BUF"><a href="#9-LCDIF-CUR-BUF" class="headerlink" title="9. LCDIF_CUR_BUF"></a><font size=3>9. LCDIF_CUR_BUF</font></h2><p>LCD Interface Current Buffer Address Register(LCDIF_CUR_BUF):</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102727298.png" alt="image-20250411102727298"  />

<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[31:0] </td>
        <td> ADDR </td>
        <td> R/W </td>
        <td> LCD控制器正在传输的当前帧在显存中的地址 </td>
    </tr>
</table>

<h2 id="10-LCDIF-NEXT-BUF"><a href="#10-LCDIF-NEXT-BUF" class="headerlink" title="10. LCDIF_NEXT_BUF"></a><font size=3>10. LCDIF_NEXT_BUF</font></h2><p>LCD Interface Next Buffer Address Register(LCDIF_NEXT_BUF):</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411102749667.png" alt="image-20250411102749667"  />

<table style="font-size: 13px">
    <tr>
        <td> 位域 </td>
        <td> 名称 </td>
        <td> 读写 </td>
        <td> 描述 </td>
    </tr>
    <tr>
        <td>[31:0] </td>
        <td> ADDR </td>
        <td> R/W </td>
        <td> 下一帧在显存中的地址 </td>
    </tr>
</table>

<p>LCD控制器传输完当前帧后，会把LCDIF_NEXT_BUF寄存器的值复制到LCDIF_CUR_BUF寄存器。</p>
<h1 id="三、裸机demo"><a href="#三、裸机demo" class="headerlink" title="三、裸机demo"></a><font size=3>三、裸机demo</font></h1><h2 id="1-硬件原理图"><a href="#1-硬件原理图" class="headerlink" title="1. 硬件原理图"></a><font size=3>1. 硬件原理图</font></h2><h3 id="1-1-电路原理图"><a href="#1-1-电路原理图" class="headerlink" title="1.1 电路原理图"></a><font size=3>1.1 电路原理图</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411104720096.png" alt="image-20250411104720096"  />

<p>三个 SGM3157 的目的是在未使用 RGBLCD 的时候将 LCD_DATA7、LCD_DATA15 和 LCD_DATA23 这三个线隔离开来，因为 ALIENTEK 的屏幕的 LCD_R7&#x2F;G7&#x2F;B7这几个线用来设置 LCD 的 ID，所以这几根线上有上拉&#x2F;下拉电阻。但是 I.MX6U 的 BOOT 设置也用到了 LCD_DATA7、 LCD_DATA15 和 LCD_DATA23 这三个引脚，所以接上屏幕以后屏幕上的 ID 电阻就会影响到 BOOT 设置，会导致代码无法运行，所以先将其隔离开来，如果要使用 RGB LCD 屏幕的时候再通过 LCD_DE 将其“连接”起来。  </p>
<h3 id="1-2-连接方式"><a href="#1-2-连接方式" class="headerlink" title="1.2 连接方式"></a><font size=3>1.2 连接方式</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411104820855.png" alt="image-20250411104820855" style="zoom: 33%;" />

<h3 id="1-3-参数计算"><a href="#1-3-参数计算" class="headerlink" title="1.3 参数计算"></a><font size=3>1.3 参数计算</font></h3><p>我使用的屏幕是ATK-MD0430R-800480，读出来的ID会是0x4384。这款屏幕对应的一些时间参数如下：</p>
<table style="font-size: 13px">
    <tr>
        <td rowspan=10 align="center" width=150px>ATK-MD0430R-800480<br>ID=4384 </td>
    </tr>
    <tr>
        <td align="left" width=230px> HOZVAL（水平显示区域）
        <td align="center"> thd </td>
        </td>
        <td align="center"> 800 </td>
        <td align="center"> tCLK </td>
    </tr>
    <tr>
        <td align="left"> HSPW(horizontal sync width)
        <td align="center"> thp </td>
        </td>
        <td align="center"> 48 </td>
        <td align="center"> tCLK </td>
    </tr>
    <tr>
        <td align="left"> HBP(horizontal back porch)
        <td align="center"> thb </td>
        </td>
        <td align="center"> 88 </td>
        <td align="center"> tCLK </td>
    </tr>
    <tr>
        <td align="left"> HFP(horizontal front porth)
        <td align="center"> thf </td>
        </td>
        <td align="center"> 40 </td>
        <td align="center"> tCLK </td>
    </tr>
    <tr>
        <td align="left"> LINE（垂直显示区域）
        <td align="center"> tvd </td>
        </td>
        <td align="center"> 480 </td>
        <td align="center"> th </td>
    </tr>
    <tr>
        <td align="left"> VSPW(vertical sync width)
        <td align="center"> tvp </td>
        </td>
        <td align="center"> 3 </td>
        <td align="center"> th </td>
    </tr>
    <tr>
        <td align="left"> VBP(vertical back porch)
        <td align="center"> tvb </td>
        </td>
        <td align="center"> 32 </td>
        <td align="center"> th </td>
    </tr>
    <tr>
        <td align="left"> VFP(vertical front porch)
        <td align="center"> tvf </td>
        </td>
        <td align="center"> 13 </td>
        <td align="center"> th </td>
    </tr>
    <tr>
        <td align="left"> 像素时钟
        <td align="center"> - </td>
        </td>
        <td align="center"> 31 </td>
        <td align="center"> MHz </td>
    </tr>
</table>

<figure class="highlight txt"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">显示一行的时间： HSPW + HBP + HOZVAL + HFP</span><br><span class="line">显示一帧的时间： (VSPW+VBP+LINE+VFP) * (HSPW + HBP + HOZVAL + HFP)  </span><br><span class="line">显示一帧的时钟： (VSPW+VBP+LINE+VFP) * (HSPW + HBP + HOZVAL + HFP)</span><br><span class="line">			 =(3+32+480+13) * (48+88+800+40)</span><br><span class="line">			 =528*976</span><br><span class="line">			 =515328</span><br><span class="line">显示60帧的时钟：(VSPW+VBP+LINE+VFP) * (HSPW + HBP + HOZVAL + HFP) * 60</span><br><span class="line">			 =515328*60</span><br><span class="line">			 =30919680</span><br><span class="line">			 ≈30.92M</span><br><span class="line">			 ≈31M</span><br></pre></td></tr></table></figure>

<h2 id="2-生成字模"><a href="#2-生成字模" class="headerlink" title="2. 生成字模"></a><font size=3>2. 生成字模</font></h2><p>想要显示英文字符的话需要用软件生成字模，这里可以用PCtoLCD2002 。字模选项设置界面。设置界面中点阵格式和取模方式等参数配置如图 </p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411115351151.png" alt="image-20250411115351151"  />

<p>上图设置的取模方式，在右上角的取模说明里面有，即：从第一列开始向下每取 8 个点作为一个字节，如果最后不足 8 个点就补满 8 位。取模顺序是从高到低，即第一个点作为最高位。如*——-取为 10000000。其实就是按下图的方式：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/02IMX6ULL%E5%B9%B3%E5%8F%B0/LV10-LCD%E9%A9%B1%E5%8A%A8/LV10-01-LCD%E9%A9%B1%E5%8A%A8-03-LCD%E6%8E%A7%E5%88%B6%E5%99%A8/img/image-20250411115435787.png" alt="image-20250411115435787" style="zoom: 80%;" />

<p>从上到下，从左到右，高位在前。我们按这样的取模方式，然后把 ASCII 字符集按 12*6 大小、 16*8、 24*12 和 32*16 大小取模出来（对应汉字大小为 12*12、 16*16、 24*24 和 32*32，字符的只有汉字的一半大！）。将取出的点阵数组保存在 font.h 里面，每个 12*6 的字符占用 12 个字节，每个 16*8 的字符占用 16 个字节，每个 24*12 的字符占用 36 个字节，每个 32*16 的字符占用 64 个字节。   </p>
<h2 id="3-demo源码"><a href="#3-demo源码" class="headerlink" title="3. demo源码"></a><font size=3>3. demo源码</font></h2><p>看这里：<a target="_blank" rel="noopener" href="https://gitee.com/sumumm/imx6ull-bare-demo/tree/master/21_lcd/01_lcd_demo">21_lcd&#x2F;01_lcd_demo · 苏木&#x2F;imx6ull-bare-demo - 码云 - 开源中国</a>。</p>
<h3 id="3-1-出现的报错问题"><a href="#3-1-出现的报错问题" class="headerlink" title="3.1 出现的报错问题"></a><font size=3>3.1 出现的报错问题</font></h3><p>这里有个坑，就是关于内联函数的。接下来看一下：</p>
<p>原本在 <a target="_blank" rel="noopener" href="https://gitee.com/sumumm/imx6ull-bare-demo/blob/master/21_lcd/01_lcd_demo/bsp/lcd/bsp_lcd.c">21_lcd&#x2F;01_lcd_demo&#x2F;bsp&#x2F;lcd&#x2F;bsp_lcd.c</a>文件中定义了两个内联函数：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment"> * @description		: 画点函数 </span></span><br><span class="line"><span class="comment"> * @param - x		: x轴坐标</span></span><br><span class="line"><span class="comment"> * @param - y		: y轴坐标</span></span><br><span class="line"><span class="comment"> * @param - color	: 颜色值</span></span><br><span class="line"><span class="comment"> * @return 			: 无</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">inline</span> <span class="type">void</span> <span class="title function_">lcd_drawpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y,<span class="type">unsigned</span> <span class="type">int</span> color)</span></span><br><span class="line">&#123; </span><br><span class="line">  	*(<span class="type">unsigned</span> <span class="type">int</span>*)((<span class="type">unsigned</span> <span class="type">int</span>)tftlcd_dev.framebuffer + </span><br><span class="line">		             tftlcd_dev.pixsize * (tftlcd_dev.width * y+x))=color;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment"> * @description		: 读取指定点的颜色值</span></span><br><span class="line"><span class="comment"> * @param - x		: x轴坐标</span></span><br><span class="line"><span class="comment"> * @param - y		: y轴坐标</span></span><br><span class="line"><span class="comment"> * @return 			: 读取到的指定点的颜色值</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">inline</span> <span class="type">unsigned</span> <span class="type">int</span> <span class="title function_">lcd_readpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y)</span></span><br><span class="line">&#123; </span><br><span class="line">	<span class="keyword">return</span> *(<span class="type">unsigned</span> <span class="type">int</span>*)((<span class="type">unsigned</span> <span class="type">int</span>)tftlcd_dev.framebuffer + </span><br><span class="line">		   tftlcd_dev.pixsize * (tftlcd_dev.width * y + x));</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>然后在<a target="_blank" rel="noopener" href="https://gitee.com/sumumm/imx6ull-bare-demo/blob/master/21_lcd/01_lcd_demo/bsp/lcd/bsp_lcd.h">21_lcd&#x2F;01_lcd_demo&#x2F;bsp&#x2F;lcd&#x2F;bsp_lcd.h</a>中做如下声明：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">inline</span> <span class="type">void</span> <span class="title function_">lcd_drawpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y,<span class="type">unsigned</span> <span class="type">int</span> color)</span>;</span><br><span class="line"><span class="keyword">inline</span> <span class="type">unsigned</span> <span class="type">int</span> <span class="title function_">lcd_readpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y)</span>;</span><br></pre></td></tr></table></figure>

<p>这样在编译的时候会警告，说有找不到这两个函数定义。这个，一般来说，内联函数最好是定义在头文件中，并且加上static关键字保证一定可以展开。</p>
<h3 id="3-2-解决办法"><a href="#3-2-解决办法" class="headerlink" title="3.2 解决办法"></a><font size=3>3.2 解决办法</font></h3><p>这里若是想要在.h文件中声明，在.c文件中实现，需要在 <a target="_blank" rel="noopener" href="https://gitee.com/sumumm/imx6ull-bare-demo/blob/master/21_lcd/01_lcd_demo/bsp/lcd/bsp_lcd.c">21_lcd&#x2F;01_lcd_demo&#x2F;bsp&#x2F;lcd&#x2F;bsp_lcd.c</a>文件中定义两个内联函数：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment"> * @description		: 画点函数 </span></span><br><span class="line"><span class="comment"> * @param - x		: x轴坐标</span></span><br><span class="line"><span class="comment"> * @param - y		: y轴坐标</span></span><br><span class="line"><span class="comment"> * @param - color	: 颜色值</span></span><br><span class="line"><span class="comment"> * @return 			: 无</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">inline</span> <span class="type">void</span> <span class="title function_">lcd_drawpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y,<span class="type">unsigned</span> <span class="type">int</span> color)</span></span><br><span class="line">&#123; </span><br><span class="line">  	*(<span class="type">unsigned</span> <span class="type">int</span>*)((<span class="type">unsigned</span> <span class="type">int</span>)tftlcd_dev.framebuffer + </span><br><span class="line">		             tftlcd_dev.pixsize * (tftlcd_dev.width * y+x))=color;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment"> * @description		: 读取指定点的颜色值</span></span><br><span class="line"><span class="comment"> * @param - x		: x轴坐标</span></span><br><span class="line"><span class="comment"> * @param - y		: y轴坐标</span></span><br><span class="line"><span class="comment"> * @return 			: 读取到的指定点的颜色值</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">inline</span> <span class="type">unsigned</span> <span class="type">int</span> <span class="title function_">lcd_readpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y)</span></span><br><span class="line">&#123; </span><br><span class="line">	<span class="keyword">return</span> *(<span class="type">unsigned</span> <span class="type">int</span>*)((<span class="type">unsigned</span> <span class="type">int</span>)tftlcd_dev.framebuffer + </span><br><span class="line">		   tftlcd_dev.pixsize * (tftlcd_dev.width * y + x));</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>然后在<a target="_blank" rel="noopener" href="https://gitee.com/sumumm/imx6ull-bare-demo/blob/master/21_lcd/01_lcd_demo/bsp/lcd/bsp_lcd.h">21_lcd&#x2F;01_lcd_demo&#x2F;bsp&#x2F;lcd&#x2F;bsp_lcd.h</a>中做如下声明：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">void</span> <span class="title function_">lcd_drawpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y,<span class="type">unsigned</span> <span class="type">int</span> color)</span>;</span><br><span class="line"><span class="type">unsigned</span> <span class="type">int</span> <span class="title function_">lcd_readpoint</span><span class="params">(<span class="type">unsigned</span> <span class="type">short</span> x,<span class="type">unsigned</span> <span class="type">short</span> y)</span>;</span><br></pre></td></tr></table></figure>

<p>我一般还是直接定义到头文件去。</p>

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/562ab748.html">LV10-01-LCD驱动-03-LCD控制器</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2025年04月16日 - 20:55</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/562ab748.html" title="LV10-01-LCD驱动-03-LCD控制器">https://sumumm.github.io/post/562ab748.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV10-LCD%E9%A9%B1%E5%8A%A8/" rel="tag"><i class="fa fa-tag"></i> LV10-LCD驱动</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/f5b59420.html" rel="prev" title="LV10-01-LCD驱动-04-Linux下的LCD驱动">
                  <i class="fa fa-angle-left"></i> LV10-01-LCD驱动-04-Linux下的LCD驱动
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/3e5a6532.html" rel="next" title="LV10-01-LCD驱动-02-LCD时序分析">
                  LV10-01-LCD驱动-02-LCD时序分析 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
